import request from '@/utils/request'

// 查询SQL执行列表
export function listTask(query) {
  return request({
    url: '/console/task/list',
    method: 'get',
    params: query
  })
}

// 查询SQL执行详细
export function getTask(id) {
  return request({
    url: '/console/task/' + id,
    method: 'get'
  })
}

// 新增SQL执行
export function addTask(data) {
  return request({
    url: '/console/task',
    method: 'post',
    data: data
  })
}

// 修改SQL执行
export function updateTask(data) {
  return request({
    url: '/console/task',
    method: 'put',
    data: data
  })
}

// 删除SQL执行
export function delTask(id) {
  return request({
    url: '/console/task/' + id,
    method: 'delete'
  })
}

export function sqlTaskExecuteSql(data) {
  return request({
    url: '/console/sqlTask/executeSql',
    method: 'post',
    data: data
  })
}

export function sqlTaskList(data) {
  return request({
    url: '/console/sqlTask/list',
    method: 'post',
    data: data
  })
}

export function sqlTaskDel(data) {
  return request({
    url: '/console/sqlTask/remove',
    method: 'post',
    data: data
  })
}

export function sqlReadPreview(data) {
  return request({
    url: '/console/sqlTask/readPreview',
    method: 'post',
    data: data
  })
}

